<script setup>
import { defineProps } from 'vue';
import emitter from "@/utils/eventBus";
// 控制折叠的逻辑
const { isCollapse } = defineProps(['isCollapse'])
// 点击分类重新获取课程列表
const courerHandle=(type)=>{
  emitter.emit('course',type)
}
</script>

<template>

  <el-menu
      class="el-menu-vertical-demo"
      active-text-color="#fffff"
      background-color="#409eff"
      text-color="#fff"
      :collapse="isCollapse"

  >
    <div class="aside_ico">
      <img src="../assets/logo.png" alt="logo">
      <span>小吴课程管理系统</span>
    </div>
<!--    课程管理-->
    <el-sub-menu index="1">
      <template #title>
        <el-icon><Memo /></el-icon>
        <span>课程管理</span>
      </template>
        <el-menu-item index="1-1" @click="courerHandle('qian')">前端课程</el-menu-item>
        <el-menu-item index="1-2" @click="courerHandle('font')">后端课程</el-menu-item>
    </el-sub-menu>
<!--用户管理-->
    <el-sub-menu index="2">
      <template #title>
        <el-icon><UserFilled /></el-icon>
        <span>用户管理</span>
      </template>
      <el-menu-item index="2-1">用户1</el-menu-item>
      <el-menu-item index="2-2">用户2</el-menu-item>
    </el-sub-menu>
  </el-menu>
</template>

<style lang="less" scoped>

.aside_ico{
  height: 60px;
  display: flex;
  align-items: center;
  text-align: center;
  border-bottom: 1px solid white;
  background-color: antiquewhite;
  white-space: nowrap;
}
.aside_ico img{
  width: 30px;
  height: 30px;
  margin: 10px 18px;
}
.aside_ico span{
  font-size: 21px;
  margin-right: 10px;
}

</style>